home *** CD-ROM | disk | FTP | other *** search
- Path: xs4all.nl!not-for-mail
- From: yrozijn@xs4all.nl (Yvon Rozijn)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: AmiTCP and threads
- Date: 7 Apr 1996 17:33:45 GMT
- Organization: XS4ALL, networking for the masses
- Message-ID: <4k8u9p$2pa@news.xs4all.nl>
- References: <9604061820.AA00093@entire.demon.co.uk>
- NNTP-Posting-Host: asd01-29.dial.xs4all.nl
- X-Newsreader: TIN [AMIGA 1.3 950726BETA PL0]
-
- Mike Gooder (mike@entire.demon.co.uk) wrote:
-
- : times with CreateNewProcTags(). Since AmiTCP will not allow the
- : sharing of SocketBase between tasks, each time this function is
- : started as a thread it needs it's own SocketBase.
- : Is there a way of doing this or am i going about this the wrong
- : way ?
-
- void __saveds yourprocess(void)
- { struct Library *SocketBase;
- ...
- if(SocketBase=OpenLibrary("bsdsocket.library",0))
- { ...
- /* do your TCP stuff here */
- somefunction(SocketBase,...) /* if you need to call other functions */
- ...
- CloseLibrary(SocketBase);
- }
- }
-
- void somefunction(struct Library *SocketBase,...)
- { ...
- }
-
- In this way the library base pointer is allocated on the stack and passed
- through to other functions. Since the AmiTCP header file uses #pragma
- libcall to define the library entry points, this will work fine.
-
- --
- ___ _
- Q : | #| : \|/ http://www. : [_]_
- -<_>- Yvon : | ==| yrozijn@ : >WWW< xs4all.nl/ : === ) Amiga
- / \ Rozijn : `---' xs4all.nl : /|\ ~yrozijn : O 4000
-